<table id="dg-wbcx" style="height:100%;width: 100%;">
    <thead data-options="frozen:true">
    <tr>
        <th field="ck" checkbox="true"></th>
        <th data-options="field:'GS_MC',sortable:true,width:80">公司名称</th>
        <th data-options="field:'GSB_MC',sortable:true,width:100">小公司名称</th>
        <th data-options="field:'RY_XM',sortable:true,width:80">员工姓名</th>
        <th data-options="field:'RY_ZJLX',width:120">证件类型</th>
        <th data-options="field:'RY_ZJHM',sortable:true,width:150">证件号码</th>
        <th data-options="field:'USER_XM',sortable:true,width:90">负责人</th>
        <th data-options="field:'RY_ZT',formatter:RyztFormatter,sortable:true,width:80">人员状态</th>
    </tr>
    </thead>
    <thead>
    <tr>
        <th data-options="field:'RY_LXFS',width:100">联系方式</th>
        <th data-options="field:'RY_DNH',sortable:true,width:80">电脑号</th>
        <th data-options="field:'RY_KHBH',sortable:true,width:80">客户编号</th>
        <th data-options="field:'PQDLFS',width:80">派遣代理</th>
        <th data-options="field:'RY_BRSF',width:80">本人身份</th>

        <th data-options="field:'RY_QSR',formatter:DateFormatter,sortable:true,width:80">起始日</th>
        <th data-options="field:'RY_ZZR',formatter:DateFormatter,sortable:true,width:80">终止日</th>
        <th data-options="field:'RY_XDSJ',formatter:DateFormatter,sortable:true,width:80">下单时间</th>
        <th data-options="field:'RY_ZYCGRQ',formatter:DateFormatter,sortable:true,width:80">增员成功日期</th>
        <th data-options="field:'RY_XZJSJ',formatter:DateFormatter,sortable:true,width:80">下增减时间</th>

        <th data-options="field:'RY_LZSJ',formatter:DateFormatter,sortable:true,width:80">离职时间</th>
        <th data-options="field:'RY_LZYY',width:250">离职原因</th>
        <th data-options="field:'RY_LXQK',width:250">离职联系情况</th>
        <th data-options="field:'RY_BLLZQK',width:250">办理离职情况</th>
        <th data-options="field:'RY_LZBZ',width:250">离职备注</th>
        <th data-options="field:'RY_JPSJ',formatter:DateFormatter,sortable:true,width:80">解聘时间</th>

        <th data-options="field:'RY_SBH',sortable:true,width:150">社保编号</th>
        <th data-options="field:'RY_GJJH',sortable:true,width:150">公积金号</th>
        <th data-options="field:'SBJNDMC',width:80">社保缴纳地</th>
        <th data-options="field:'GJJJNDMC',width:80">公积金缴纳地</th>
        <th data-options="field:'SBZHMC',width:100">社保缴纳账户</th>
        <th data-options="field:'SBZHBH',width:100">社保缴纳账号</th>
        <th data-options="field:'RY_SFKGSB',width:150">谁付款给社保局</th>
        <th data-options="field:'GJJZHMC',width:100">公积金缴纳账户</th>
        <th data-options="field:'GJJZHBH',width:100">公积金缴纳账号</th>
        <th data-options="field:'RY_SFKGGJJ',width:150">谁付款给公积金</th>
        <th data-options="field:'RY_GJJSFGW',width:150">公积金费谁付款给我们</th>
        <th data-options="field:'RY_FWFJN',width:150">服务费青分/青岛</th>
        <th data-options="field:'SBBZ',width:200">社保备注</th>
        <th data-options="field:'GJJBZ',width:200">公积金备注</th>

        <th data-options="field:'GZ_NDSB',align:'right',width:80">年度社保基数</th>
        <th data-options="field:'GZ_NDGJJ',align:'right',width:80">年度公积金基数</th>
        <th data-options="field:'GZ_GSBL',align:'right',width:80">公司比例</th>
        <th data-options="field:'GZ_GRBL',align:'right',width:80">个人比例</th>
        <th data-options="field:'GZ_GSJN',align:'right',width:80">公司金额</th>
        <th data-options="field:'GZ_GRJN',align:'right',width:80">个人金额</th>
        <th data-options="field:'GZ_SBJNHJ',align:'right',width:80">缴纳合计</th>

        <th data-options="field:'GZ_FWF',align:'right',width:80">服务费</th>
        <th data-options="field:'GZ_DAF',align:'right',width:80">档案费</th>
        <th data-options="field:'GZ_RSBZ',align:'right',width:80">人身保障</th>
        <th data-options="field:'GZ_MZYL',align:'right',width:80">门诊医疗</th>
        <th data-options="field:'GZ_TJ',align:'right',width:80">体检</th>
        <th data-options="field:'GZ_ZDJB',align:'right',width:80">重大疾病</th>
        <th data-options="field:'GZ_ZYBT',align:'right',width:80">住院补贴</th>
        <th data-options="field:'GZ_ZNMZ',align:'right',width:80">子女门诊</th>
        <th data-options="field:'GZ_ZNYW',align:'right',width:80">子女意外</th>
        <th data-options="field:'GZ_JC',align:'right',width:80">家财</th>
        <th data-options="field:'GZ_SR',align:'right',width:80">联谊慰问1</th>
        <th data-options="field:'GZ_HD',align:'right',width:80">联谊慰问2</th>
        <th data-options="field:'GZ_QNF',align:'right',width:80">取暖费</th>
        <th data-options="field:'GZ_XCSJ',align:'right',width:80">薪酬及税金服务</th>
        <th data-options="field:'GZ_QT1',align:'right',width:80">其他一</th>
        <th data-options="field:'GZ_QT1BZ',width:150">其他一备注</th>
        <th data-options="field:'GZ_SJ',align:'right',width:80">税金</th>

        <th data-options="field:'LRRMC',sortable:true,width:90">录入人</th>
        <th data-options="field:'LRSJ',formatter:DateTimeFormatter,sortable:true,width:125">录入时间</th>
        <th data-options="field:'XGRMC',sortable:true,width:90">最后修改人</th>
        <th data-options="field:'XGSJ',formatter:DateTimeFormatter,sortable:true,width:125">最后修改时间</th>
        <th data-options="field:'BZ',sortable:true,width:200">备注</th>
    </tr>
    </thead>
</table>

<div id="tb-wbcx">
    <table cellpadding="0" cellspacing="3" style="width:100%">
        <tr class="clearfix">
            <td nowrap>公司名称:</td>
            <td><input class="easyui-textbox" name="dg_wbcx_gsmc" id="dg_wbcx_gsmc" style="width:120px"></td>
            <td nowrap>小公司名称:</td>
            <td><input class="easyui-textbox" name="dg_wbcx_xgsmc" id="dg_wbcx_xgsmc" style="width:120px"></td>
            <td nowrap>负责人:</td>
            <td><select class="easyui-combobox" data-options="prompt:'请选择',panelHeight:'auto',url:'${ctxPath}/dm/user', method:'post',valueField:'USER_ID',textField:'USER_XM',editable:true,width:120" id="dg_wbcx_lrr" name="dg_wbcx_lrr"></select></td>
            <td nowrap>人员状态:</td>
            <td><select class="easyui-combobox" data-options="panelHeight:'auto',width:120" id="dg_wbcx_cxryzt" name="dg_wbcx_cxryzt">
                <option value="">请选择</option>
                <option value="1" selected>未办</option>
            </select>
            </td>
            <td nowrap>员工姓名:</td>
            <td><input class="easyui-textbox" name="dg_wbcx_xm" id="dg_wbcx_xm" style="width:120px"></td>
        </tr>
        <tr class="clearfix">
            <td nowrap>身份证号码:</td>
            <td><input class="easyui-textbox" name="dg_wbcx_sfzhm" id="dg_wbcx_sfzhm" style="width:120px"></td>
            <td nowrap>电脑号：</td>
            <td><input class="easyui-textbox" name="dg_wbcx_dnh" id="dg_wbcx_dnh" style="width:120px"></td>
            <td nowrap>客户编号：</td>
            <td><input class="easyui-textbox" name="dg_wbcx_khbh" id="dg_wbcx_khbh" style="width:120px"></td>
            <td nowrap>查询日期起：</td>
            <td><input class="easyui-my97" name="dg_wbcx_cxrqq" id="dg_wbcx_cxrqq" data-options="dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'dg_wbcx_cxrqz\')}'" style="width:80px"></td>
            <td nowrap>查询日期止：</td>
            <td><input class="easyui-my97" name="dg_wbcx_cxrqz" id="dg_wbcx_cxrqz" data-options="dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'dg_wbcx_cxrqq\')}'" style="width:80px"></td>
        </tr>
        <tr class="clearfix">
            <td class="luck-tool-button" colspan="10">
                <a href="#" class="easyui-linkbutton" iconCls="icon-search" onclick="wbcx_tool.search();">${i18n('btn.search')}</a>
                <a href="#" class="easyui-linkbutton button-blue" plain="true" onclick="wbcx_tool.edit();"><i class="fa fa-plus fa-lg"></i>&nbsp;${i18n('btn.zy')}</a>
                <a href="#" class="easyui-linkbutton button-primary" plain="true" onclick="wbcx_tool.export();"><i class="fa fa-file-excel-o fa-lg"></i>&nbsp;${i18n('btn.export')}</a>
            </td>
        </tr>
    </table>
</div>
<script>
    var cmenukey = "${user('userid')}_wbcx";
    var dg_wbcx;
    $(function () {
        dg_wbcx = rsdp.createDataGrid({
            tid: "dg-wbcx",
            url: "${ctxPath}/dbrw/wbcx/manage",
            idField: "RY_ID",
            loadMsg: "${i18n('oper.loading')}",
            tbid: "tb-wbcx",
            singleSelect: false,
            multiSort: true,
            onHeaderContextMenu: function (e, field) {
                e.preventDefault();
                var cmenu;
                if (!cmenu) {
                    cmenu = createColumnMenu("dg-wbcx", cmenukey);
                }
                cmenu.menu('show', {
                    left: e.pageX,
                    top: e.pageY
                });
            },
            onLoadSuccess:function(data){
        			setDataGridColumnShow("dg-wbcx", cmenukey);
        		}
        });
    });

    var wbcx_tool = {
        edit: function () {
            var rows = getCheckedRows('#dg-wbcx');
            if (rows.length == 1) {
                rsdp.createDialog({
                    url: "${ctxPath}/dbrw/wb",
                    title: "${i18n('msg.htxx.zy')}",
                    width: '80%',
                    height: '80%',
                    param: {id: rows[0].RY_ID},
                    btnArray: [{
                        cls: 'easyui-linkbutton button-blue',
                        iconCls: 'fa fa-check fa-lg',
                        text: "${i18n('btn.save')}",
                        handler: function () {
                            wbcx_tool.edit_save();
                        }
                    },
                        {
                            iconCls: 'fa fa-close fa-lg',
                            text: "${i18n('btn.close')}",
                            handler: function () {
                                rsdp.closeDialog();
                            }
                        }]
                });
            }
            else {
                //layer.msg("${i18n('msg.row.select')}", {time: 1000});
            		rsdp.msg("${i18n('msg.row.select')}", {time: 1000});
            }
        },
        edit_save: function () {
            rsdp.ajaxform({
                fid: "form-wb",
                url: "${ctxPath}/dbrw/wbcx/wbSave",
                func: function () {
                    rsdp.closeDialog();
                    dg_wbcx.datagrid("reload");
                    dg_wbcx.datagrid("clearChecked");
                }
            });
        },
        refresh: function () {
            rsdp.refresh();
        },
        search: function () {
            dg_wbcx.datagrid('load', {
                gsmc: $('#dg_wbcx_gsmc').val(),
                xgsmc: $('#dg_wbcx_xgsmc').val(),
                xm: $('#dg_wbcx_xm').val(),
                ryzt: "",
                sfzhm: $('#dg_wbcx_sfzhm').val(),
                dnh: $('#dg_wbcx_dnh').val(),
                khbh: $('#dg_wbcx_khbh').val(),
                lrr: $('#dg_wbcx_lrr').combobox("getValue"),
                cxrqq: $('#dg_wbcx_cxrqq').my97('getValue'),
                cxrqz: $('#dg_wbcx_cxrqz').my97('getValue')
            });
            dg_wbcx.datagrid("clearChecked");
        },
        export: function (obj) {
            var form = $("<form>");
            form.attr('style', 'display:none');
            form.attr('target', '');
            form.attr('method', 'post');
            form.attr('action', "${ctxPath}/dbrw/wbcx/export");
            $('body').append(form);
            form.append(createHid("gsmc", $('#dg_wbcx_gsmc').val()));
            form.append(createHid("xgsmc", $('#dg_wbcx_xgsmc').val()));
            form.append(createHid("ryzt", ""));
            form.append(createHid("xm", $('#dg_wbcx_xm').val()));
            form.append(createHid("sfzhm", $('#dg_wbcx_sfzhm').val()));
            form.append(createHid("dnh", $('#dg_wbcx_dnh').val()));
            form.append(createHid("khbh", $('#dg_wbcx_khbh').val()));
            form.append(createHid("lrr", $('#dg_wbcx_lrr').combobox('getValue')));
            form.append(createHid("cxrqq", $('#dg_wbcx_cxrqq').val()));
            form.append(createHid("cxrqz", $('#dg_wbcx_cxrqz').val()));
            form.submit();
            form.remove();
        }
    }
</script>